﻿<!DOCTYPE>

<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=EDGE;IE=11;IE=8,chrome=1" />
    <title>渗碳炉批记录打印</title>
    <link href="/InSiteWebApplication/Content/Easyui/themes/metro/easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/custom-easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/themes/icon.css" rel="stylesheet" />
    <style type="text/css">
        .dg{list-style:none;width:400px;height:40px;line-height:40px;float:left;border:1px solid;text-align: center;font-size: 16px;}
        .labelT{width:200px;display: inline-block;text-align: left;font-size: 16px;margin-top: 10px;}
        label{font-size: 16px;}
    </style>
</head>
<body>
      <div style="text-align: center;margin-top:30px">
            <div style="font-size: 25px;">渗  碳  炉  批  记  录</div>
            <div style=""><label>日期：</label><span class="labelT STDATE"></span><label>试样编号：</label><span class="labelT SAMPLENO"></span><label>操作者：</label><span class="labelT CREATEEMPLOYEE"></span></div>
            <div style="display: inline-block;width:800px;margin:10px 25px" id="dg"></div>
            <div><span class="labelT" style="width:800px;margin:0px;">注：试样编号为“ST”+渗碳日期,如ST20220930。</span></div>
      </div>
</body>
</html>
<script src="/InSiteWebApplication/Scripts/json2.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Scripts/CustomPageJs/CustomCommon.js" type="text/javascript"></script>
<script>
/*
创建人：longb
日期：2022-09-26
描述：热处理记录js
*/
    var page = {
        workflowstepid: getParam("id"),
        ContainerID: getParam("ContainerID"),
        rootPath: getRootPath(), //网站根路径
        ajaxUrl: getRootPath() + "/Ashx/GongZhuangContainer/GZHeatRecordInfoHandler.ashx",
        //初始化页面
        init: function () {
            //page.bind();
            page.GZSTContainerRecord();
        },
        //查询热处理记录
        GZSTContainerRecord: function () {
            var param = {
                action: "GZSTContainerRecord",
                ContainerID: page.ContainerID,
                workflowstepid: page.workflowstepid
            };
            page.post(param, function (res) {
                if (res.Result) {
                    if (res.DBDataSet.base.length == 0) {
                        $('.STDATE').text(res.ReturnData.STDATE);
                        $('.SAMPLENO').text(res.ReturnData.SAMPLENO);
                        $('.CREATEEMPLOYEE').text(res.ReturnData.CREATEEMPLOYEE);
                    } else {
                        $('.STDATE').text(res.DBDataSet.base[0].STDATE);
                        $('.SAMPLENO').text(res.DBDataSet.base[0].SAMPLENO);
                        $('.CREATEEMPLOYEE').text(res.DBDataSet.base[0].CREATEEMPLOYEE);
                    }
                    var dghtml = "<div class='dg'>图号</div><div class='dg'>图号</div>";
                    $.each(res.DBDataSet.dg, function (index, item) {
                        dghtml += "<div class='dg'>" + item.DRAWINGNO + "</div>";
                    });
                    if (res.DBDataSet.dg.length <= 40) {
                        for (var i = 0; i < 40 - res.DBDataSet.dg.length; i++) {
                            dghtml += "<div class='dg'></div>";
                         }
                    }
                    if (res.DBDataSet.dg.length%2!=0) {
                        dghtml += "<div class='dg'></div>";
                     }
                    $('#dg').empty().html(dghtml);
                }
            });
        },
        //post数据
        post: function (param, callback) {
            $.ajax({
                type: "Post",
                url: page.ajaxUrl,
                data: param,
                cashe: false,
                async: true,
                dataType: "json",
                beforeSend: function () {
                    $.messager.progress({ text: '', msg: '处理中...' });
                },
                success: function (data) {
                    $.messager.progress('close');
                    callback(data);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    $.messager.progress('close');
                    displayMessage(XMLHttpRequest.responseText, false);
                }
            });
        }
    }
$(function () {
    page.init();
});
</script>
